#include "Timer.h"

void Timer::start() {
    start_ = getRealTime();
}

void Timer::stop() {
    stop_ = getRealTime();
}

double Timer::getTime() {
    return stop_-start_;
}

double Timer::getRealTime() {
    struct timeval tv;
    gettimeofday(&tv,0);
    return (double)tv.tv_sec+1.0e-6*(double)tv.tv_usec;
}
